<template>
	<view class="container">
		<view class="yy-su-head">
			<view class="yy-su-headtitle">
				<view class="yy-su-headtitleImg">
					<image src="../../static/icon_suss.png" mode="widthFix"></image>
				</view>
				<text>预约成功</text>
			</view>
			<text class="yy-su-headtip">请准时于就诊前 前往医院门诊就诊</text>
		</view>
		<view class="yy-su-navhead">
			<view class="yy-su-navhead-bg"></view>
		</view>
		<view class="yy-su-con">
			<view class="yy-su-con-title">
				<view class="line"></view>
				<text>预约号</text>
				<view class="line"></view>
			</view>
			<view class="yy-su-con-num">
				<text class="yy-su-con-num">{{ordercon.code}}</text>
			</view>
			<view class="yy-su-con-list">
				<view class="yy-su-con-item">
					<text>候诊时间</text>
					<text class="yy-su-con-Sitem">{{ordercon.make_time}}</text>
				</view>
				<view class="yy-su-con-item">
					<text>就诊医院</text>
					<text>{{ordercon.hospital_name}}</text>
				</view>
				<view class="yy-su-con-item">
					<text>就诊科室</text>
					<text>{{ordercon.department_name}}</text>
				</view>
				<view class="yy-su-con-item">
					<text>就诊医生</text>
					<text>{{ordercon.nickname}}</text>
				</view>
				<view class="yy-su-con-item">
					<text>就诊人</text>
					<text>{{ordercon.user_member_name}}</text>
				</view>
			</view>
		</view>
		<view class="yy-su-btn" @click="comtation">完成</view>
	</view>
</template>

<script>
	import app from '../../App.vue'
	export default{
		data(){
			return{
				order_id:'',
				ordercon:''
			}
		},
		onLoad(options) {
			this.order_id = options.order_id
			this.getorderdetail()
		},
		onShow() {
			
		},
		methods:{
			getorderdetail(){
				let that = this,
				data = {
					order_id:that.order_id
				}
				app.post('api/order/orderInfo',data).then(res=>{
					if(res.code == 1){
						that.ordercon = res.data
						console.log(res.data)
					}else if(res.code == 0){
						uni.showToast({
							title: res.msg,
							icon: 'none',
							mask: true
						})
					}else if(res.code == 401){
						uni.showToast({
							title: res.msg,
							icon: 'none',
							mask: true
						})
					}
				}).catch(err=>{
					uni.showToast({
						title: err.msg,
						icon: 'none',
						mask: true
					})
				})
			},
			comtation(){
				uni.showLoading({
					title:'加载中',
					success() {
						setTimeout(function(){
							uni.hideLoading()
							uni.reLaunch({
								url:'/pages/index/index'
							})
						},1300)
					}
				})
			}
			
		}
	}
</script>

<style>
	@import url("../../common/yuyuesuccess.css");
</style>
